package com.ejlchina.tool.util

/**
 * 下载事件
 */
class DownloadEvent(val status: Int) {

    override fun toString(): String {
        return when (status) {
            STATUS_PENDING -> "DOWNLOAD IS PENDING"
            STATUS_RUNNING -> "DOWNLOAD IS RUNNING"
            STATUS_PAUSED -> "DOWNLOAD IS PAUSED"
            STATUS_SUCCESSFUL -> "DOWNLOAD IS SUCCESSFUL"
            STATUS_FAILED -> "DOWNLOAD IS FAILED"
            else -> "DOWNLOAD STATUS UNKNOWN"
        }
    }

    companion object{
        const val STATUS_PENDING = 1
        const val STATUS_RUNNING = 2
        const val STATUS_PAUSED = 4
        const val STATUS_SUCCESSFUL = 8
        const val STATUS_FAILED = 16
    }
}